<?php

namespace app\common\dict;

class TaskStatusDict
{


    /**
     * 等待执行
     */
    const INIT = 0;

    /**
     * 执行中
     */
    const RUNNING = 1;

    /**
     * 执行成功
     */
    const SUCCESS = 2;

    /**
     * 执行失败
     */
    const FAILURE = 3;


    /**
     * 执行超时
     */
    const TIMEOUT = 4;

    public static function getDict(): array
    {
        return [
            self::INIT => '等待执行',
            self::RUNNING => '执行中',
            self::SUCCESS => '成功',
            self::FAILURE => '失败',
            self::TIMEOUT => '超时',
        ];
    }



    public static function getDictValue(int $key): string
    {
        $dict = self::getDict();
        return $dict[$key] ?? '未知';
    }



}